function request(method, url, data) {
  return new Promise((resolve, reject) => {
    let header = {
      'content-type': 'application/json',
      'xcx-token': getApp().xcxtoken
    };
    wx.request({
      url: url,
      method: method,
      data: data,
      header: header,
      success: res => {
        resolve(res);
      },
      fail: err => {
        reject(err)
      }
    });
  })
}

module.exports = {
  request: request
}